<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>考试系统</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="../static/js/jquery.js"></script>
    <style>
        /* 全局样式 - 适用于所有页面 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }
        :root {
            --primary-color: #3b82f6;
            --primary-dark: #2563eb;
            --primary-light: #eff6ff;
            --secondary-color: #64748b;
            --success-color: #10b981;
            --danger-color: #ef4444;
            --text-color: #1e293b;
            --text-light: #64748b;
            --border-color: #e2e8f0;
            --bg-color: #f8fafc;
            --card-bg: #ffffff;
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --transition: all 0.2s ease;
            --search-height: 2.5rem;
            --search-gap: 6px;
        }
        body {
            background-color: var(--bg-color);
            color: var(--text-color);
            line-height: 1.5;
        }

        /* 按钮样式 - 全局通用 */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.5rem 1rem;
            border-radius: 0.375rem;
            font-weight: 500;
            font-size: 0.875rem;
            cursor: pointer;
            transition: var(--transition);
            border: none;
        }

        .btn.primary {
            background-color: var(--primary-color);
            color: white;
        }

        .btn.primary:hover {
            background-color: var(--primary-dark);
            transform: translateY(-1px);
            box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
        }

        /* 表单元素样式 */
        .form-select {
            padding: 0.625rem 1rem;
            border: 1px solid var(--border-color);
            border-radius: 0.375rem;
            font-size: 0.875rem;
            background-color: white;
            transition: var(--transition);
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11l4-4H4l4 4z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 0.75rem center;
            background-size: 1em;
        }

        .form-select:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        /* 主容器样式 */
        .main-container {
            padding: 2rem;
            max-width: 1200px;
            margin: 0 auto;
        }

        /* 筛选栏样式 */
        .filter-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border-color);
        }

        .filter-options {
            display: flex;
            gap: 1rem;
        }

        /* 考试列表样式 */
        .exam-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
        }

        .exam-card {
            background-color: var(--card-bg);
            border-radius: 0.5rem;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            transition: var(--transition);
            cursor: pointer;
        }

        .exam-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }

        .exam-card h3 {
            margin-bottom: 1rem;
            color: var(--text-color);
        }

        .exam-info {
            margin-bottom: 1rem;
        }

        .exam-info p {
            margin-bottom: 0.5rem;
            font-size: 0.875rem;
            color: var(--text-light);
        }

        .status {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 999px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        /* 考试状态样式（未开始、进行中、已结束） */
        .status.未开始 {
            background-color: rgba(100, 116, 139, 0.1);
            color: var(--secondary-color);
        }

        .status.进行中 {
            background-color: rgba(16, 185, 129, 0.1);
            color: var(--success-color);
        }

        .status.已结束 {
            background-color: rgba(239, 68, 68, 0.1);
            color: var(--danger-color);
        }

        /* 考试卡片状态区分 */
        .exam-card.status-未开始 {
            border-left: 4px solid var(--secondary-color);
        }

        .exam-card.status-进行中 {
            border-left: 4px solid var(--success-color);
        }

        .exam-card.status-已结束 {
            border-left: 4px solid var(--danger-color);
        }
        /* 我的考试卡片样式 */
        .exam-card.my-exam {
            border-left: 4px solid #4CAF50;
            box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
        }

        /* 我的考试标签样式 */
        .my-exam-tag {
            display: inline-block;
            background-color: #4CAF50;
            color: white;
            font-size: 12px;
            padding: 2px 6px;
            border-radius: 4px;
            margin-left: 8px;
        }
        /* 弹窗样式 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal.show {
            display: flex;
        }

        .modal-content {
            background-color: var(--card-bg);
            border-radius: 0.5rem;
            width: 90%;
            max-width: 500px;
            padding: 2rem;
            box-shadow: var(--shadow);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .close-modal {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--text-light);
        }

        .modal-body p {
            margin-bottom: 1rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--border-color);
        }

        /* 加载提示样式 */
        .loading {
            text-align: center;
            padding: 2rem;
            color: var(--text-light);
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .filter-bar {
                flex-direction: column;
                align-items: flex-start;
                gap: 1rem;
            }

            .filter-options {
                width: 100%;
                flex-wrap: wrap;
            }

            .form-select {
                flex: 1;
                min-width: 150px;
            }

            .exam-list {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>
<div class="main-container">
    <div class="filter-bar">
        <div class="filter-options">
            <select id="examStatusFilter" class="form-select">
                <option value="all">全部考试</option>
                <option value="active">进行中的考试</option>
            </select>
        </div>

        <div class="sort-options">
            <select id="sortOrder" class="form-select">
                <option value="desc">时间倒序</option>
                <option value="asc">时间正序</option>
            </select>
        </div>
    </div>

    <div id="examList" class="exam-list">
        <!-- 考试卡片将通过JavaScript动态生成 -->
        <div class="loading">加载中...</div>
    </div>
</div>

<!-- 考试详情弹窗 -->
<div id="examModal" class="modal">
    <div class="modal-content">
        <div class="modal-header">
            <h2 id="modalTitle"></h2>
            <button class="close-modal" id="closeModal">&times;</button>
        </div>
        <div class="modal-body" id="modalBody">
            <!-- 弹窗内容将通过JavaScript动态生成 -->
        </div>
    </div>
</div>

<!-- JavaScript 引用（仅保留引用路径，不包含具体代码） -->
<script src="../static/js/examsystem.js"></script>
</body>
</html>